import Vue from 'vue';
import VueRouter from 'vue-router';

import { xpf } from './xpf';
import { yh } from './yh';
import { lj } from './lj';
import { myt } from './myt';
import { bb } from './bb';
import { lk } from './lk';

Vue.use(VueRouter);

const routes = [...xpf, ...yh, ...lj, ...myt, ...bb, ...lk];
const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes,
});

export default router;

const originalReplace = VueRouter.prototype.replace;
VueRouter.prototype.replace = function replace(location) {
    return originalReplace.call(this, location).catch(err => err);
};
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
    return originalPush.call(this, location).catch(err => err)
}

